<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-bind</title>
    <style>
        .textColor {
            color: blue;
        }
    </style>
</head>
<body>
    <div id="app">
        <h1>{{ title }}</h1>
        <!-- :value -->
        <h3>v-bind:value="web.url"</h3>
        <input type="text" v-bind:value="web.url">
        <h3>:value="web.url"</h3>
        <input type="text" :value="web.url">

        <!-- :class -->
        <h3>:class="{textColor: web.fontStatus}"</h3>
        <b :class="{textColor: web.fontStatus}">https://wwww.baidu.com</b>

        <!-- :src -->
        <h3>src="windows.jpg"</h3>
        <img :src="web.img" alt="windows">

    </div>

    <script type="module">
        import {createApp, reactive} from './js/vue.esm-browser.js'

        // v-bind 
        createApp({
            // setup选项，用于设置响应式数据和方法等 
            setup() {
                // reactive 创建响应式对象，用于存储复杂的数据类型，例如：对象、数组
                const web = reactive({
                    url: "https://www.baidu.com",
                    img: "./img/snowfight.jpg",
                    fontStatus: false
                })

                return {
                    title: "v-bind",
                    web
                }
            }
        }).mount("#app")
    </script>
</body>
</html>